package com.gexiaobao.pigeon.ui.dialog

import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Bitmap
import android.view.LayoutInflater
import android.view.View
import androidx.appcompat.widget.AppCompatTextView
import com.gexiaobao.pigeon.R
import com.makeramen.roundedimageview.RoundedImageView

/**
 * @Author      : hxw
 * @Date        : 2024/7/19 9:17
 * @Describe    :
 */
class RxDialogUpLoadProof(context: Context?) : RxDialog(context!!) {

    private lateinit var cancelView: AppCompatTextView
    private lateinit var sureView: AppCompatTextView
    private lateinit var rIvProofFileImage: RoundedImageView

    init {
        initView()
    }

    @SuppressLint("MissingInflatedId")
    private fun initView() {
        val dialogView = LayoutInflater.from(context).inflate(R.layout.dialog_upload_proof, null)
        cancelView = dialogView.findViewById(R.id.tvCancel)
        sureView = dialogView.findViewById(R.id.tvSure)
        rIvProofFileImage = dialogView.findViewById(R.id.rIvProofFileImage)

        cancelView.setOnClickListener {
            dismiss()
        }
        setContentView(dialogView)
    }

    fun setImage(bitmap: Bitmap) {
        rIvProofFileImage.setImageBitmap(bitmap)
    }

    fun setIvListener(listener: View.OnClickListener?) {
        rIvProofFileImage.setOnClickListener(listener)
    }

    fun setSureListener(listener: View.OnClickListener?) {
        sureView.setOnClickListener(listener)
    }

}